using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using XVUEfxSDK.Xsequencer;
using XVUEfxSDK.Xplugin;
using XVUEfxSDK.Xplugin.Xuserinterface;

namespace SamplesCSharp.AdvancedPlugins
{
    [XvuePluginUIInfo(AuthorName = "Angel",CompanyName= "XVUE",PluginName="Live And DVE Advanced")]
    public partial class LiveAndDVEAdvanced : xvuePluginUI
    {
        public LiveAndDVEAdvanced()
        {
            InitializeComponent();
        }

        public override string ToString()
        {
            return "Live, DVE and Item Reference";
        }

        public override IXvueSequencerUser xSequencer
        {
            get
            {
                return base.xSequencer;
            }
            //do here any initializations or closing
            set
            {
                base.xSequencer = value;
                groupBoxUI.Enabled = false;
                buttonPrepare.Enabled = true;
            }
        }

        private void buttonPrepare_Click(object sender, EventArgs e)
        {
            XvueSequencerGroupBase group = new XvueSequencerGroupBase();
            group.XvEffectTAG = "GroupLive";

            //We add live directly to the group/layer for this sample
            XvueSequencerItemLiveBase live = new XvueSequencerItemLiveBase();
            live.XvEffectTAG = "LiveWithDVE";
            live.xVisualProperties.xScale.X = 0.5;
            live.xVisualProperties.xScale.Y = 0.5;

            group.xAddItem(live);
            xSequencer.xQueSequencerItem(group);

            groupBoxUI.Enabled = true;
            buttonPrepare.Enabled = false;
        }

        private void buttonClearAll_Click(object sender, EventArgs e)
        {
            xSequencer.xCommand("XVUE", XvueSequencerCommandType.ClearAllItems);

            buttonPrepare.Enabled = true;
            groupBoxUI.Enabled = false;
        }
    }
}
